Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

182
Visualizações
How to use "NOT LIKE" for a column values in SQL

So I have a table like this:

X.        Y.
34560     eudhkri 34560 abc
26558     hsyrb 26558 ax
3666      dhurb 3666 yzhdj
3666      dhfhjf 366688 avh
233       abc 233 hdhsijej

Since characters in the Y column are changeable (meaning they have different number of letters) I thought I might use the NOT LIKE operator to exclude the rows where the X value is in the Y column.

However, I don't know how. It is not possible to just write it every values of X down. Also, I wrote the 4th row specifically to show you I can't exclude this data since the numbers are not same, so using % might cause some trouble.

over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

You could use a regular expression:

WHERE y ~ ('\m' || x || '\M')

\m marks the beginning of a word, \M the end.

over 4 years ago · Santiago Trujillo Relatório

0

if you want to use the like operatoe you could try this way

select *
from my_table 
where y NOT like concat('%',x,'%')

or

select *
from my_table 
where y NOT like concat('% ', x,' %')
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda